package com.team11.server.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.team11.server.mapper.SelAllUser;
import com.team11.server.pojo.dto.RespPageBean;
import com.team11.server.pojo.dto.Users;
import com.team11.server.service.SelUserService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;

@Service
public class SelUserServiceImpl implements SelUserService {
    @Resource
    private SelAllUser selAllUser;

    @Override
    public RespPageBean SelUser(Integer currentPage, Integer size) {
        QueryWrapper<Users> wrapper= new QueryWrapper<>();
        wrapper.eq("is_delete",1);
        Page<Users> page=new Page<>(currentPage,size);
        IPage<Users> usersByPage=selAllUser.selectPage(page,wrapper);
        return new RespPageBean(usersByPage.getTotal(),usersByPage.getRecords());
    }
}
